﻿using JmShared;
using SuperWebSocket.SubProtocol;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using WebSocketServer.Filters;

namespace WebSocketServer.Commands
{
        [LogTimeCommandFilter(Order = 0)]
    public class VerifyRegisterAccountMail : JsonSubCommand<JiveClientSession, VerifyMail>
    {
        protected override void ExecuteJsonCommand(JiveClientSession session, VerifyMail vm)
        {
           var result= DB.DbManager.VerifyRegistrationMail(vm.Username, vm.VerificationCode);

            SendJsonMessage(session, new DatabaseQueryResponse(result.Success, result.StatusText));
        }
    }
}
